package guaduation.enums;

public enum OrderEnums {
    IDENTIFY(1, "A0 03 82 00 DB"),
    READ(2, "A0 06 80 00 01 02 01 D6"),
    STOP(3, "A0 03 A8 00 B5"),
    IDENTIFY_AGAIN(4, " A0 03 FC 00 61"),
    GET_DATA_AGAIN(5, "A0 03 FF 00 5E"),
    GET_DATA(6, "A0 03 A6 00 B7");

    private Integer index;
    private String order;

    OrderEnums(Integer index, String order) {
        this.index = index;
        this.order = order;
    }

    public static String getOrderByIndex(Integer index) {
        for (OrderEnums value : OrderEnums.values()) {
            if (value.index.equals(index)) {
                return value.order;
            }
        }
        return "";
    }

    public Integer getIndex() {
        return index;
    }

    public void setIndex(Integer index) {
        this.index = index;
    }

    public String getOrder() {
        return order;
    }

    public void setOrder(String order) {
        this.order = order;
    }
}
